import * as React from 'react';
import { HashRouter, Route, Switch } from 'react-router-dom';
import { App } from './app';
import { About, MembersPage } from './components';

// AppRouter 报错void 0 原因：安装了 @type/react 里面封装了限制类型约束接口
// StatelessComponent 无状态组件 现在简写为FC(FunctionComponent)
// <{}>泛型 强类型语言中的概念 可以约束props中参数的类型

export const Approuter: React.FC<{}> = () => {
    return (
        <HashRouter>
            <div className="container-fluid">
                <Route component={App}></Route>
                <Switch>
                    <Route exact path="/" component={About}></Route>
                    <Route path="/about" component={About}></Route>
                    <Route path="/members" component={MembersPage}></Route>
                </Switch>
            </div>
        </HashRouter>
    )
}